<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<p>支付成功</p>
<p><span id="num">5</span>秒种，自动返回</p>
</body>
<script type="text/javascript">
   var n=4;
   function show() {
       var num=document.getElementById("num")
       num.innerHTML=n--;
       if(-1==n){
           clearInterval(f);
           history.back();
       }

   }
   var f=setInterval("show",1000);
</script>
</html>